package org.peoples.rooms {
	
	import org.peoples.users.User;
	
	public class RoomHandler implements IRoomHandler {
		
		private var rooms:RoomPool;
		
		public function RoomHandler():void {
			this.rooms = RoomPool.getInstance();
		}
		
		public function addRoomUser(room:RoomProperties, user:User):void {
			var temp_room:RoomProperties = rooms.getRoom(room.ID);
			temp_room.addUser(user);
		}
		
		public function createRoom(room:RoomProperties):void {
			rooms.addRoom(room);
		}
		
		public function removeRoom(room:RoomProperties):void {
			rooms.removeRoom(room.ID);
		}
		
		public function removeRoomUser(room:RoomProperties, user:User):void {
			var temp_room:RoomProperties = rooms.getRoom(room.ID);
			temp_room.removeUser(user);
		}
		
	}
	
}